3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
QuickDraw 3D provides several routines that you can use to operate on any QuickDraw 3D object. The top level of the QuickDraw 3D class hierarchy ( TQ3Object ) supports dispose, duplicate, draw, and file I/O methods.
You can use the Q3Object_Submit function to submit a QuickDraw 3D object for drawing, picking, bounding, or writing.
TQ3Status Q3Object_Submit (TQ3Object object, TQ3ViewObject view);
You can use the Q3Object_Dispose function to dispose of a QuickDraw 3D object.
TQ3Status Q3Object_Dispose (TQ3Object object);
The Q3Object_Dispose function disposes of the QuickDraw 3D object specified by the object parameter. If the specified object is not a shared object, QuickDraw 3D disposes of any memory occupied by that object. If the specified object is a shared object, QuickDraw 3D reduces by 1 the reference count associated with that object. When the reference count is reduced to 0, Q3Object_Dispose disposes of the memory occupied by the object.
In general, you need to call Q3Object_Dispose for any objects returned by a Get call (for example, Q3View_GetDrawContext ). Failure to call Q3Object_Dispose on such objects will result in a memory leak.
You can use the Q3Object_Duplicate function to duplicate a QuickDraw 3D object.
TQ3Object Q3Object_Duplicate (TQ3Object object);
The Q3Object_Duplicate function returns, as its function result, a QuickDraw 3D object that is an exact duplicate of the QuickDraw 3D object specified by the object parameter. If the new object is a shared object, its reference count is set to 1.
The Q3Object_Duplicate function cannot duplicate DrawContext or View objects. These object classes contain resources created by the application that belong to the window system. Because the QuickDraw 3D library cannot duplicate windows or colormaps, it cannot duplicate objects containing them.
You can use the Q3Object_IsDrawable function to determine whether a QuickDraw 3D object is drawable.
TQ3Boolean Q3Object_IsDrawable (TQ3Object object);
You can use the Q3Object_IsWritable function to determine whether a QuickDraw 3D object is writable.
TQ3Boolean Q3Object_IsWritable (TQ3Object object);
Previous | QD3D Book | Overview | Chapter Contents | Next |